package com.shd.edanpei.bean;

import com.shd.edanpei.common.Constant;
import com.shd.edanpei.enums.OrderTypeEnum;
import com.shd.edanpei.util.DateUtils;

import java.util.List;

public class ProductBean {

    //区域编码集合
    private List<String> areaCode;

    //区域名称集合
    private String areaDesc;

    /**
     * 订单最高金额
     */
    private String loanMax;

    /**
     * 预计审核时间
     */
    private String loanDay;


    /**
     * 最大利率
     */
    private String rateMax;

    /**
     * 最小利率
     */
    private String rateMin;

    /**
     * 最大年龄
     */
    private String ageMax;

    /**
     * 最小年龄
     */
    private String ageMin;


    /**
     * 车公里数
     */
    private String travelWkm;

    /**
     * 车年限
     */
    private String cartYear;

    /**
     * 归还方式
     */
    private String repayMode;

    /**
     * 订单期限
     */
    private String repayTerm;

    /**
     * 住房年限
     */
    private String roomAge;

    /**
     * 住房面积
     */
    private String roomSize;
    /**
     * 所需材料
     */
    private String loanData;

    private String createTime;
    private String id;
    private boolean isUp;
    private String productType;
    private String states;
    private String userId;

    public List<String> getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(List<String> areaCode) {
        this.areaCode = areaCode;
    }

    public String getAreaDesc() {
        return areaDesc;
    }

    public void setAreaDesc(String areaDesc) {
        this.areaDesc = areaDesc;
    }

    public String getLoanMax() {
        return loanMax == null ? null : loanMax + Constant.Unit.WANYUAN.getUnit();
    }

    public void setLoanMax(String loanMax) {
        this.loanMax = loanMax;
    }

    public String getLoanDay() {
        return loanDay;
    }

    public void setLoanDay(String loanDay) {
        this.loanDay = loanDay;
    }

    public String getRateMax() {
        return rateMax;
    }

    public void setRateMax(String rateMax) {
        this.rateMax = rateMax;
    }

    public String getRateMin() {
        return rateMin;
    }

    public void setRateMin(String rateMin) {
        this.rateMin = rateMin;
    }

    public String getAgeMax() {
        return ageMax;
    }

    public void setAgeMax(String ageMax) {
        this.ageMax = ageMax;
    }

    public String getAgeMin() {
        return ageMin;
    }

    public void setAgeMin(String ageMin) {
        this.ageMin = ageMin;
    }

    public String getTravelWkm() {
        return travelWkm == null ? null : travelWkm + Constant.Unit.WANKM.getUnit();
    }

    public void setTravelWkm(String travelWkm) {
        this.travelWkm = travelWkm;
    }

    public String getCartYear() {
        return cartYear;
    }

    public void setCartYear(String cartYear) {
        this.cartYear = cartYear;
    }

    public String getRepayMode() {
        return repayMode;
    }

    public void setRepayMode(String repayMode) {
        this.repayMode = repayMode;
    }

    public String getRepayTerm() {
        return repayTerm;
    }

    public void setRepayTerm(String repayTerm) {
        this.repayTerm = repayTerm;
    }

    public String getLoanData() {
        return loanData;
    }

    public void setLoanData(String loanData) {
        this.loanData = loanData;
    }

    public String getRoomAge() {
        return roomAge;
    }

    public void setRoomAge(String roomAge) {
        this.roomAge = roomAge;
    }

    public String getRoomSize() {
        return roomSize;
    }

    public void setRoomSize(String roomSize) {
        this.roomSize = roomSize;
    }

    public String getCreateTime() {
        return DateUtils.formatTime(Long.parseLong(createTime), Constant.Time.YYYY_MM_DD.getTime());
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isUp() {
        return isUp;
    }

    public void setUp(boolean up) {
        isUp = up;
    }

    public int getProductType() {
        return Integer.parseInt(productType);
    }

    public String getProduct() {
        return OrderTypeEnum.getValue(Integer.parseInt(productType));
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public String getStates() {
        return states;
    }

    public void setStates(String states) {
        this.states = states;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getName() {
        return Integer.parseInt(productType) == OrderTypeEnum.car.getKey() ? "新增车辆产品" : "新增住房产品";
    }

    public String getButtonStatus() {
        return isUp ? "下架" : "上架";
    }

}